<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>详情</title>
	<script th:src="@{/layui/layui.js}" type="text/javascript"></script>
	<link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
</head>
<body>

<div style="margin: 20px">
	<form class="layui-form layui-form-pane">
		<input type="hidden" id="id" name="id" th:value="${os.id}">


		<!--个人模块-->
		<div class="layui-form-item">
			<label class="layui-form-label">用户名称</label>
			<div class="layui-input-block">
				<input readonly class="layui-input" th:value="${os.mid}" name="mid"  autocomplete="off"/>
			</div>

		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">用户头像</label>
			<div class="layui-input-block">
				<input readonly class="layui-input" th:value="${os.userUrl}" name="userUrl" autocomplete="off"/>
			</div>
		</div>


		<!--订单模块-->
		<div class="layui-form-item">
			<label class="layui-form-label">订单编号</label>
			<div class="layui-input-block">
				<input readonly class="layui-input" th:value="${os.orderSn}" name="orderSn" autocomplete="off"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">订单金额</label>
			<div class="layui-input-block">
				<input readonly class="layui-input" th:value="${os.orderPrice}" name="orderPrice" autocomplete="off"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">实付金额</label>
			<div class="layui-input-block">
				<input readonly class="layui-input" th:value="${os.actualPrice}" name="actualPrice" autocomplete="off"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">下单时间</label>
			<div class="layui-input-block">
				<input readonly class="layui-input" th:value="${os.createTime}" name="createTime" autocomplete="off"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">付款时间</label>
			<div class="layui-input-block">
				<input readonly class="layui-input" th:value="${os.payTime}" name="payTime" autocomplete="off"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">订单状态</label>
			<div class="layui-input-block">
				<input disabled="disabled" type="radio" name="orderStatus" value="0" title="已完成订单"  th:checked="${os.orderStatus} eq '0' " />
				<input disabled="disabled" type="radio" name="orderStatus" value="1" title="待支付订单"  th:checked="${os.orderStatus} eq '1' " />
				<input disabled="disabled" type="radio" name="orderStatus" value="2" title="支付异常订单"  th:checked="${os.orderStatus} eq '2' " />
				<input disabled="disabled" type="radio" name="orderStatus" value="3" title="代发货订单"  th:checked="${os.orderStatus} eq '3' " />
				<input disabled="disabled" type="radio" name="orderStatus" value="4" title="待收货订单"  th:checked="${os.orderStatus} eq '4' " />
				<input disabled="disabled" type="radio" name="orderStatus" value="5" title="退换货订单"  th:checked="${os.orderStatus} eq '5' " />
				<input disabled="disabled" type="radio" name="orderStatus" value="6" title="退款订单"  th:checked="${os.orderStatus} eq '6' " />
			</div>
		</div>


		<!--物流模块-->
		<div class="layui-form-item">
			<label class="layui-form-label">收货人</label>
			<div class="layui-input-block">
				<input readonly class="layui-input" th:value="${os.shipName}" name="shipName" autocomplete="off"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">收货电话</label>
			<div class="layui-input-block">
				<input readonly class="layui-input" th:value="${os.mobile}" name="mobile" autocomplete="off"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">物流单号</label>
			<div class="layui-input-block">
				<input readonly class="layui-input" th:value="${os.shipSn}" name="shipSn" autocomplete="off"/>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">物流公司</label>
			<div readonly class="layui-input-block layui-disabled">
				<input disabled="disabled" type="radio" name="shipChannel" value="0" title="顺丰快递"  th:checked="${os.shipChannel} eq '0' " />
				<input disabled="disabled" type="radio" name="shipChannel" value="1" title="其他快递"  th:checked="${os.shipChannel} eq '1' " />
				<input disabled="disabled" type="radio" name="shipChannel" value="2" title="未发货"  th:checked="${os.shipChannel} eq '2' " />
			</div>
		</div>


		<div class="layui-form-item" style="display: none;">
			<div class="layui-input-block">
				<a class="layui-btn" id="submitBtn" lay-submit="" lay-filter="submitBtn">提交</a>
			</div>
		</div>
	</form>
</div>

<!---->
<script>
	var $;
	layui.use(['table','laydate','form','jquery','layer','upload','element'],function() {
		var table = layui.table,
				layer = layui.layer,
				form = layui.form,
				upload = layui.upload,
				element = layui.element,
				laydate = layui.laydate;
				$ = layui.jquery;

		laydate.render({
			elem: '#updateTime' //指定元素
		});


		form.on('submit(submitBtn)',function (data) {
			var formData = data.field;
			$.ajax({
				type:'post',
				url:'/order/oc/update',
				data:formData,
				dataType:'json',
				success:function (result) {
					layer.msg(result.msg);
					if (result.is){
						let index = parent.layer.getFrameIndex(window.name);
						parent.layer.close(index);  //编辑成功后关闭父页面窗口
						parent.layui.table.reload('orderTable');//根据表格id刷新父页面表格
					}
				}
			})
		})

	});

	function btnSubmit() {
		$('#submitBtn').click();
	}
</script>

</body>
</html>